<?php


namespace app\api\model;


use think\Model;
use app\common\model\Dynamic as DynamicModel;
use app\api\model\Comment;
class Dynamic extends DynamicModel
{

    /**
     * 动态表关联到用户表
     *
     * @return \think\model\relation\HasMany
     *
     */
    public function users()
    {
        return $this->hasMany('Users','id','user_id');
    }

    /**
     * 动态表关联评论表
     *
     */

    public function comments()
    {
        return $this->hasMany('Comment','dynamic_id','id');
    }
}